//
//  NSMutableAttributedString+CalculateFrame.m
//  caishuitong
//
//  Created by 企友软mac on 2017/5/10.
//  Copyright © 2017年 zhangxy. All rights reserved.
//

#import "NSMutableAttributedString+CalculateFrame.h"

@implementation NSMutableAttributedString (CalculateFrame)

- (NSMutableAttributedString *)setTextColorWithStr:(NSString *)str Color:(UIColor *)color Range:(NSRange)range{
    
    if (str == nil) return nil;
    
    NSMutableAttributedString *newStr = [[NSMutableAttributedString alloc] initWithString:str];
    
    [newStr addAttribute:NSForegroundColorAttributeName value:color range:range];
    
    return newStr;
    
}

- (NSMutableAttributedString *)setTextFontWithStr:(NSString *)str Font:(UIFont *)font Range:(NSRange)range{
    
    if (str == nil) return nil;
    
    NSMutableAttributedString *newStr = [[NSMutableAttributedString alloc] initWithString:str];
    
    [newStr addAttribute:NSFontAttributeName value:font range:range];
    
    return newStr;
    
}

@end
